import '@/favicon.ico'

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import {
    BrowserRouter as Router,
    Route,
    Link
  } from 'react-router-dom';
import Index from './pages/pc/Index';
import WapIndex from './pages/wap/Index';
import User from './pages/pc/User';

import { isMobile } from './utils/index';

class App extends Component {
    render() {
        let Content;
        if(isMobile()){
            Content = (
                <div>
                    <Route exact path="/" component={WapIndex}></Route>
                </div>
            )                  
        }else{
            Content = ( 
                <div>
                    <Route exact path="/" component={Index} /> 
                    <Route exact path="/user" component={User} />
                </div>
            )
        }
        return(
            <Router>
                <div>
                    { Content }
                </div>
            </Router>
        )
    }
}

const myDiv = document.createElement('div');
document.body.appendChild(myDiv);

ReactDOM.render(<App/>, myDiv);